<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Str_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-str_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[str_time]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_ids" data-rule="required" data-source="goods/index" data-multiple="true" class="form-control selectpage" name="row[goods_ids]" type="text" value="">
        </div>
    </div>
    <div class="form-group row">
        <div>
            <!--data-template的值作为行中的id值，才能便于追加行与引用-->
            <table class="table fieldlist" data-template="linedetail" data-name="row[linedetail]" id="linetable" style="width: 80%;margin-left: 25px">
                <thead>
                <tr class="info">
                    <th>项目名称</th>
                    <th>库存</th>
                    <th>秒杀价</th>
                    <th>费用</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody class="lyj_tbody">
                </tbody>
                <tbody>
                <!--name中<%=name%>表示的是data-template为此地的id值linedetail,对应的data-name的值linedetail-->
                <script id="linedetail" type="text/html" name="linedetail">
                    <tr class="active">


                        <td>
                            <input type="text"   id="name<%=index+1%>" class="form-control"  data-line="<%=index+1%>" name="<%=name%>[<%=index%>][name]"/>
                        </td>
                        // 料号名称
                        <td>
                            <input type="text"  class="form-control" id="product_name<%=index+1%>" name="<%=name%>[<%=index%>][product_name]"  />
                        </td>
                        // 规格型号
                        <td>
                            <input type="text"  class="form-control" id="costmode_name<%=index+1%>" name="<%=name%>[<%=index%>][costmode_name]"  />
                        </td>
                        // 单位
                        <td>
                            <input type="text"  onblur = "cost_money()" class="form-control" id="cost_money<%=index+1%>" name="<%=name%>[<%=index%>][cost_money]" style="width: 100px"/>
                        </td>
                        <td>
                            <span class="btn btn-sm btn-danger btn-removeline"><i class="fa fa-times"></i></span>
                        </td>
                    </tr>
                </script>


                </tbody>
                <tr>
                    <td>
                        <!--<span data-url="cost/select?product_id=" class="form-control fachoosetable" data-line="<%=index+1%>">选择</span>-->
                    <td colspan="1"><a href="javascript:;" class="btn btn-sm btn-success fachoosetable"><i class="fa fa-plas"></i>选择</a></td>
                    </td>
                    <!-- <td colspan="1"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plas"></i>添加行</a></td>-->
                </tr>
            </table>
            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea id="textarea1" name="linedetail" class="form-control hidden" cols="30" rows="5"></textarea>
        </div>
    </div>x
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
